function User(name, interests) {
    this.name = name;
    this.interests = interests;
    this.greeting = function() {
        console.log('Hi, I\'m ' + this.name + ".");
    }
}

//将 Object.create()方法使用
//User构造函数的prototype
//****函数以的value的形式加入
//****这种方式只加入到user对象上
var user = Object.create(User.prototype, {
    name: {value: 'Sunny'},
    interests: {value: ['Traveling', 'Swimming4']},
    greeting : {value: function () {
        console.log('***Hi, I\'m ' + this.name + ".");
    }, enumerable: true }
});

console.log(user.name);

//在Object.create（）的第二个参数中传递。
user.greeting(); 

